package com.cloudlead.plugin.security.vo;

import com.cloudlead.common.lang.annotation.Unique;
import com.cloudlead.common.lang.persistence.AbstractIdEntity;

import com.cloudlead.plugin.security.action.validator.ScRoleValidatorGroup.*;

import javax.validation.constraints.Size;
import com.cloudlead.common.lang.annotation.Domain;
import java.lang.Boolean;
import com.cloudlead.common.lang.annotation.Label;
import java.lang.String;
import javax.validation.constraints.NotNull;

/**
 * ScRole is a Codegen vo type
 */
@Unique("name")
@Domain(domainClassName="com.cloudlead.plugin.security.entity.EScRole")
@Label("角色")
public class ScRole extends AbstractIdEntity<String> {

    private static final long serialVersionUID =1743655980219L;    
    @NotNull(groups={Create.class,Update.class})
    @Label("是否有效")
    private Boolean available;

    @Size(max=255)
    @Label("描述")
    private String description;

    @NotNull(groups={Update.class})
    @Size(max=24)
    @Label("编号")
    private String id;

    @NotNull(groups={Create.class,Update.class})
    @Size(max=100)
    @Label("角色名称")
    private String name;

    @Size(max=24)
    @Label("上级编号")
    private String pid;

    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String toString() {
         return String.format("ScRole { available : %s,description : %s,id : %s,name : %s,pid : %s }",available,description,id,name,pid);
    }

}

